<%@ page language="java" contentType="text/html; charset=UTF-8"
         pageEncoding="UTF-8" %>
<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<!DOCTYPE html>
<html>
<head>
    <meta charset="UTF-8">
    <title>个人信息修改</title>
    <link rel="stylesheet" type="text/css" href="css/public.css"/>
    <link rel="stylesheet" type="text/css" href="css/login.css"/>
    <script src=js/jquery-1.12.4.min.js></script>
    <script src="js/function.js"></script>

    <style>
        .reg P .error {
            display: inline-block;
            background-color: #ff0000;
            height: 20px;
            line-heigth: 25px;
            padding-left: 5px;
            margin-left: 0px;
        }

    </style>
</head>
<body><!-------------------reg-------------------------->
<div class="reg">
    <form action="modify_userInfo" method="post" onsubmit="return checkForm(this)"><h1><a href="index.html">
        <!--  img src="学习猿地" -->个人信息修改</a></h1>
        <p><input type="text" name="userName" value="${name.USER_ID}" readonly>
        <p><input type="text" name="name" value="${name.USER_NAME}" onfocus="FocusItem(this)" onblur="CheckItem(this)"
                  placeholder="用户姓名"><span></span></p>
        <p><input type="text" name="passWord" value="${name.USER_PASSWORD}" onfocus="FocusItem(this)" onblur="CheckItem(this)"
                  placeholder="密码"><span></span></p>
        <p><input type="text" name="rePassWord" value="${name.USER_PASSWORD}" onfocus="FocusItem(this)" onblur="CheckItem(this)"
                  placeholder="确认密码"><span></span></p>
        <p>
            <c:choose>
                <c:when test="${name.USER_SEX == 'T'}">
                    <input style="width:15px; height:15px" type="radio" name="sex" value="T" checked="checked">男
                    <input style="width:15px; height:15px" type="radio" name="sex" value="F">女
                </c:when>
                <c:otherwise>
                    <input style="width:15px; height:15px" type="radio" name="sex" value="T">男
                    <input style="width:15px; height:15px" type="radio" name="sex" value="F" checked>女
                </c:otherwise>
            </c:choose>
        </p>
        <p>
            <input type="date" name="birthday" id="birthdayInput"><span></span></p>
        <p><input type="text" name="email" value="${name.USER_EMAIL}" placeholder="邮箱"><span></span></p>
        <p><input type="text" name="idcard" value="${name.USER_IDENITY_CODE}" placeholder="身份证"><span></span></p>
        <p><input type="text" name="mobile" value="${name.USER_MOBILE}" placeholder="电话号码"><span></span></p>
        <p><input type="text" name="address" value="${name.USER_ADDRESS}" placeholder="地址"><span></span></p>
        <p><input type="submit" name="" value="修改"></p>
        <!--<a href="#" class="off"><img src="img/temp/off.png"></a>--></form>
</div>
</body>
</html>
<script>
    // 获取带日期和时间的字符串
    var dateTimeString = "${name.USER_BIRTHDAY}";

    // 将日期时间字符串转换为日期对象
    var dateTimeParts = dateTimeString.split(" "); // 分割日期和时间部分
    var datePart = dateTimeParts[0]; // 获取日期部分

    // 将日期部分设置为日期选择器的值
    document.getElementById("birthdayInput").value = datePart;
</script>

